Total Complexity | 1 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import {Controller, Inject, UseGuards, Query, Get} from '@nestjs/common'; |
||
10 | |||
11 | @Controller('faircalendar') |
||
12 | @ApiTags('FairCalendar') |
||
13 | @ApiBearerAuth() |
||
14 | @UseGuards(AuthGuard('bearer'), RolesGuard) |
||
15 | export class GetMonthlyFairCalendarAction { |
||
16 | constructor( |
||
17 | @Inject('IQueryBus') |
||
18 | private readonly queryBus: IQueryBus |
||
19 | ) {} |
||
20 | |||
21 | @Get() |
||
22 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
23 | @ApiOperation({summary: 'Get monthly faircalendar by user'}) |
||
24 | public async index(@Query() dto: MonthlyEventsDTO) { |
||
25 | return await this.queryBus.execute( |
||
26 | new GetMonthlyFairCalendarQuery(new Date(dto.date), dto.userId) |
||
27 | ); |
||
30 |